home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / DOPbt41 / 4 / rexx / conv.lha->lzx.rexx < prev    next >
OS/2 REXX Batch file  |  1995-04-18  |  1KB  |  61 lines

  1. /* $VER: 2.00 convert lha to lzx 
  2.  
  3.   Use with opus to convert ONE file at a time from lha to lzx.
  4.  
  5.   Create a button named LHA->LZX saying
  6.  
  7.   AmigaDOS    rx dopus:modules/rexx/conv.lha->lzx.rexx {f}
  8.  
  9.   FLAGS:
  10.   Do all files
  11.   No filename quote
  12.   Output window
  13.   Rescan source
  14.   
  15.   script will delete the extracted files and
  16.   delete the original file (.lha that is)
  17.  
  18.  
  19.   OR use from a shell
  20. */
  21.  
  22. ARG file
  23.  
  24. if ~show(l,"rexxsupport.library") then
  25. call addlib("rexxsupport.library",0,-30,0)
  26.  
  27. if file = '' then signal usage
  28. if file = '?' then signal usage
  29.  
  30. test = right(file,3)
  31. if test ~= 'LHA' then signal NOPE
  32. else say 'LHA to LZX by Niels <ABC>...working on -> 'file
  33.  
  34. NewFile = Left(File,Length(file)-3)'lzx'
  35. makedir('sys:repack')
  36.  
  37. Address COMMAND 'c:assign repack: sys:repack'
  38. Address COMMAND 'delete repack:#? all force >nil:'
  39. Address COMMAND 'c:LHA -a -F -M x' file '#? REPACK:'
  40. Address COMMAND 'c:LZX -r -e -M500 -3 -F a ' newfile 'repack:#?'
  41. Address COMMAND 'delete' file '>nil:'
  42. Address COMMAND 'c:assign repack: remove'
  43. Address COMMAND 'c:delete sys:repack all >nil:'
  44. EXIT
  45.  
  46. USAGE:
  47.  
  48. say "USAGE: rx conv.lha->lzx [file].lha"
  49. say 
  50. say
  51. say "Will convert a single LHA-archive to LZX."
  52. say "AND delete the original LHA file..."
  53. say "(p) niels >ABC<"
  54. EXIT
  55.  
  56. NOPE:
  57. say 'I need a lha file to work on, so'
  58. say file 
  59. say 'will not work. Sorry !'
  60. say
  61. EXIT